<template>
  <div id="app" :class="darkMode === 'dark' ? 'app-dark' : 'app'">
    <h1>{{ info }}</h1>
    <keep-alive include="detail,home,addComments">
      <router-view />
    </keep-alive>
  </div>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
export default {
  data() {
    return {
      userInfo: {
        avatar: '1.png',
        nickname: 'devin',
      },
      info: null,
    }
  },
  created() {
    this.info = this.userInfo?.name
  },
  computed: {
    ...mapState(['darkMode']),
  },
}
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.app {
  color: #2c3e50;
  background: #fff;
}
.app-dark {
  color: #edf1f5;
  background: rgb(18, 2, 2);
  a {
    color: #fff;
  }
}
</style>
